package cn.supermaster.management.web.service.monitor.impl;

import cn.supermaster.management.core.web.domain.Server;
import cn.supermaster.management.web.service.monitor.IMonitorServerService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;
import org.springframework.ui.ModelMap;

/**
 * All rights Reserved, Designed By www.super-bytecode.com
 *
 * @ProjectName: supermaster-management
 * @Package: cn.supermaster.management.web.service.monitor.impl
 * @ClassName: MonitorServerServiceImpl
 * @Description: []
 * <p> </p>
 * @Author: [Lance Ting]
 * @Date: 2021/1/10 16:53
 * @Version: V1.0
 * @Copyright: 2021 www.super-bytecode.comn Inc. All rights reserved.
 * TODO: 注意,本文件Lance Ting所作,如果转载或使用请标明具体出处!
 **/
@Service
public class MonitorServerServiceImpl implements IMonitorServerService {

    private final Logger logger = LoggerFactory.getLogger(this.getClass());

    private String prefix = "monitor/server";

    /**
     * @Description: [获取系统运行服务器信息]
     * <p></P>
     * @Title: getServerInformation
     * @Author: Lance Ting
     * @Date: 2021-01-10
     * @Param: modelMap
     * @Return: java.lang.String
     * @Throws:
     */
    @Override
    public String getServerInformation(ModelMap modelMap) {
        try {
            Server server = new Server();
            server.copyTo();
            modelMap.put("server", server);
        } catch (Exception e) {
            logger.error("获取服务器信息失败，" + e.getMessage());
        }
        return prefix + "/server";
    }
}